﻿package baidu.lib.utils
{

    public class StringTemplate extends Object
    {

        public function StringTemplate()
        {
            return;
        }// end function

        public static function output(param1:String, ... args) : String
        {
            args = new activation;
            var template:* = param1;
            var args:* = args;
            if ( == null)
            {
                return "";
            }
            if (length < 1)
            {
                return ;
            }
            var result:* = replace(/\${(\w+)}""\${(\w+)}/g, function () : String
            {
                var _loc_5:* = undefined;
                arguments = arguments[1];
                var _loc_3:* = Number(arguments);
                var _loc_4:* = "";
                if (isNaN(_loc_3))
                {
                    if (args[0][arguments] != null)
                    {
                        _loc_4 = args[0][arguments].toString();
                    }
                }
                else
                {
                    _loc_5 = args[_loc_3];
                    if (_loc_5 != null)
                    {
                        _loc_4 = _loc_5.toString();
                    }
                }
                return _loc_4;
            }// end function
            );
            return ;
        }// end function

    }
}
